<?php

if(!defined('IN_UCHOME')) {
	exit('Access Denied');
}

function gethr($tablename , $wheresqlarr) {
	global $_SGLOBAL;

	$where = $comma = '';
	if(empty($wheresqlarr)) {
		$where = '1';
	} elseif(is_array($wheresqlarr)) {
		foreach ($wheresqlarr as $key => $value) {
			$where .= $comma.'`'.$key.'`'.'=\''.$value.'\'';
			$comma = ' AND ';
		}
	} else {
		$where = $wheresqlarr;
	}
	$result = $_SGLOBAL['db']->query('SELECT * from '.tname($tablename).' WHERE '.$where);
	return $_SGLOBAL['db']->fetch_array($result);
}

?>